home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4275 < prev    next >
Encoding:
Text File  |  1996-08-06  |  907 b   |  21 lines

  1. Path: news.ran.es!usenet
  2. From: mper@ran.es (Martin Percossi)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: [help] 3D Array class
  5. Date: 27 Jan 1996 20:30:12 GMT
  6. Organization: RAN INTERNET
  7. Message-ID: <4ee20k$577@news.ran.es>
  8. References: <4e5sg8$r4h@geraldo.cc.utexas.edu>
  9. NNTP-Posting-Host: ppp014.ran.es
  10.  
  11. Bad news. There is no [][][] operator in c++; only a [] operator. Now you can have
  12. 3D arrays of ints and chars, etc, because really what your doing is making an array of an array,
  13. not a fundamentally new structure. So there is no [][][] operator that you can overload. What that
  14. means is that you have to create "helper" classes. I┤m not so sure how to do this myself, but basically it 
  15. would involve making a different class for each additional "dimension", so a 3D array would require three
  16. classes in total, each having an [] that indexes the next class, if you get what I mean.
  17.  
  18. Hope this helps,
  19. Martin.
  20.  
  21.